Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

prime(0) → false
prime(s(0)) → false
prime(s(s(x))) → prime1(s(s(x)), s(x))
prime1(x, 0) → false
prime1(x, s(0)) → true
prime1(x, s(s(y))) → and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) → =(rem(x, y), 0)

Q is empty.


QTRS
  ↳ DirectTerminationProof

Q restricted rewrite system:
The TRS R consists of the following rules:

prime(0) → false
prime(s(0)) → false
prime(s(s(x))) → prime1(s(s(x)), s(x))
prime1(x, 0) → false
prime1(x, s(0)) → true
prime1(x, s(s(y))) → and(not(divp(s(s(y)), x)), prime1(x, s(y)))
divp(x, y) → =(rem(x, y), 0)

Q is empty.

We use [23] with the following order to prove termination.

Recursive Path Order [2].
Precedence:
prime1 > prime12 > false > not1
prime1 > prime12 > s1 > not1
prime1 > prime12 > true > not1
prime1 > prime12 > and2 > not1
prime1 > prime12 > divp2 > 0 > not1
prime1 > prime12 > divp2 > =2 > not1
prime1 > prime12 > divp2 > rem2 > not1